<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSnappedSkuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('snapped_sku', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('snapped_id')->unsigned()->comment('秒杀表id');

            $table->integer('type')->unsigned()->comment('秒杀类型,1是固定价格，2是折扣');

            $table->decimal('price')->unsigned()->comment('秒杀价格');

            $table->decimal('percent')->unsigned()->comment('折扣，单位折');



        });

        DB::statement("ALTER TABLE `snapped_sku` COMMENT='秒杀sku表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('snapped_sku');
    }
}
